package net.stratusprogramming.school.Game.Screens;


import net.stratusprogramming.school.Game.Framework.Screen;
import net.stratusprogramming.school.Game.Framework.Battle.Combatant;
import net.stratusprogramming.school.Game.Framework.System.InstanceMgr;

import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Input;


public class PauseScreen extends Screen {

	/** Input from slick */
	private Input input;
	/** Screen to set when done */
	private Screen retScreen;
	
	/**
	 * Creates a new Pause screen
	 * 
	 * @param retScreen screen to set when done
	 */
	public PauseScreen(Screen retScreen) {
		input = InstanceMgr.input;
		this.retScreen = retScreen;
	}
	
	@Override
	public void update(int delta) {		
		if(input.isKeyPressed(Input.KEY_P) || input.isKeyPressed(Input.KEY_ESCAPE)) {
			InstanceMgr.main.setScreen(retScreen);
		}
		if(input.isKeyPressed(Input.KEY_S)) {
			InstanceMgr.saveMgr.save();
		}
	}

	@Override
	public void render(Graphics g) {
		g.setColor(Color.white);
		g.drawString("Game is paused", 10, 25);	
		g.drawString("Press s to save", 10, 40);	
	}

}
